package org.ezaero.jmimic.impl.store;


/**
 * Provides the core functinality of a mimic store.
 * @author alex.radeski
 */
public interface MimicStore {

    /**
     * Is this store in record mode. A store is usually recording if: the mimic file does not exist, or overwrite is forced in the config.
     * @return true if recording.
     */
    boolean isRecording();

    /**
     * For the given method signature, args and return value, write a single mimic invocation.
     * @param methodSig
     * @param args
     * @param rval
     */
    void write(String methodSig, Object[] args, Object rval);

    /**
     * For the given method signature, and args, read and return a single mimic invocation.
     * @param methodSig
     * @param args
     * @return
     */
    Invocation read(String methodSig, Object[] args);

    /**
     * Close the mimic store.
     */
    void close();
}
